@@ -116,7 +116,7 @@ module Agents |
||
| 116 | 116 |
def check |
| 117 | 117 |
mqtt_client.connect do |c| |
| 118 | 118 |
|
| 119 |
- Timeout::timeout(options['max_read_time']) {
|
|
| 119 |
+ Timeout::timeout((options['max_read_time'].presence || 15).to_i) {
|
|
| 120 | 120 |
c.get(options['topic']) do |topic, message| |
| 121 | 121 |
|
| 122 | 122 |
# A lot of services generate JSON. Try that first |
@@ -16,7 +16,7 @@ describe Agents::MqttAgent do |
||
| 16 | 16 |
@valid_params = {
|
| 17 | 17 |
'uri' => "mqtt://#{@server.address}:#{@server.port}",
|
| 18 | 18 |
'topic' => '/#', |
| 19 |
- 'max_read_time' => 1, |
|
| 19 |
+ 'max_read_time' => '1', |
|
| 20 | 20 |
'expected_update_period_in_days' => "2" |
| 21 | 21 |
} |
| 22 | 22 |
|